<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .cov{
            width: 500px;
            margin: 50px auto;
        }
        .head{
            height: 30px;
            width: 100%;
            display: flex;
            justify-content: space-between;
            color: aliceblue;
            background-color: black;
        }
        span{
            line-height: 30px;
            border-radius: 10px;
            cursor: pointer;
        }
        .current{
            background-color: #bbbbbb;
            
        }
        .lis1{
            display: block;
        }
        .lis2{
            display: none;
        }
        .lis3{
            display: none;
        }
        .foot{
            border: 2px solid black;
        }
    </style>
</head>
<body>
    <div class="cov">
        <div class="head">
            <span class="s1">第一节</span>
            <span class="s2">第二节</span>
            <span class="s3">第三节</span>
        </div>
        <div class="foot">
            <ul class="lis1">
                <li>这是第一节</li>
                <li>这是第一节</li>
                <li>这是第一节</li>
                <li>这是第一节</li>
                <li>这是第一节</li>
                <li>这是第一节</li>
                <li>这是第一节</li>
                <li>这是第一节</li>
                <li>这是第一节</li>
            </ul>
            <ul class="lis2">
                <li>这是第二节</li>
                <li>这是第二节</li>
                <li>这是第二节</li>
            </ul>
            <ul class="lis3">
                <li>这是第三节</li>
                <li>这是第三节</li>
                <li>这是第三节</li>
                <li>这是第三节</li>
                <li>这是第三节</li>
                <li>这是第三节</li>
                <li>这是第三节</li>
            </ul>
        </div>
    </div>
    <script>
  var s1 = document.querySelectorAll('span');
         var lis1 = document.querySelectorAll('ul');
          for (var i = 0; i < s1.length; i++) {
            s1[i].index = i;
            s1[i].onclick = function() {
                for (var j = 0; j < s1.length; j++) {
                    s1[j].className = '';
                }
                s1[this.index].className = 'current';
                for (var n = 0; n < lis1.length; n++) {
                    lis1[n].style.display = 'none';
                }
                lis1[this.index].style.display = 'block';
            }
        }
        
    </script>
</body>
</html>